﻿using ctolua.Models.Enum;

namespace ctolua.Models.UI.control
{
    public class MCSlider : Mui
    {
        public override EUi type { get => EUi.滑动条; set => base.type = EUi.滑动条; }
        public MCSlider()
        {
        }

        public MCSlider(string id) : base(id)
        {
        }

        public MCSlider(MCSlider u) : base(u)
        {
        }

        private double? _percent;
        /// <summary>
        /// 设置滑动条的进度
        /// </summary>
        public double? percent
        {
            get => _percent;
            set
            {
                if (value != null)
                {
                    game_api.set_slider_cur_percent(this.role, this.id, value);
                }

                _percent = value;
            }
        }
        /// <summary>
        /// 获取滑动条当前值
        /// </summary>
        public double? value => game_api.get_slider_cur_percent(this.id);
    }
}
